﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project_Manager.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Project_Manager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register src="../Controls/Combo/SourceCombo.ascx" tagname="Source" tagprefix="uc5" %>
<%@ Register src="../Controls/Combo/ExpenseCombo.ascx" tagname="Expense" tagprefix="uc6" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title><asp:Literal runat="Server" id="litTitle"/></title>
</head>
<body>
    <form id="form1" runat="server">
        <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">
        
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>  
        
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None"  > 
        </telerik:RadAjaxLoadingPanel>

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="Grid_t9">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnSave_t9">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnEdit_t9">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnCancel_t9">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t9" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>    

        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">

                function isNumberKey(event) 
                {
                 var charCode = (event.which) ? event.which : event.keyCode
                 if(charCode > 31 && (charCode < 48 || charCode > 57)){
                     return false;
                  }
                 return true;
                }

                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                } 

            </script>
        </telerik:RadCodeBlock>

            <div class="defaultFont">
                <asp:Panel ID="panelHeader" runat="server" Width="830px">
                    <table cellpadding="0" cellspacing="0" class="defaultTable">
                        <tr>
                            <td align="left" valign="top" width="35%" style="padding: 5px; font-family: 'Segoe UI'; font-size: 13px; border-bottom: 3px double #959485;">
                                <ul class="treeview-list">
                                    <li class="treeview-item" style="border: none">
                                        รายการผู้รับผิดชอบโครงการ
                                    </li>
                                </ul>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="panel_Item9" runat="server" Width="830px" Height="370px" ScrollBars="Auto" HorizontalAlign="Center">
                    <table cellpadding="0" cellspacing="0" style="width: 98%; font-family: 'Segoe UI'; font-size: 13px">
                        <tr valign="top">
                            <td align="center" colspan="3" style="padding-top:15px;">
                                <asp:Label ID="lbProjectID" runat="server" Visible="false"></asp:Label>
                                <asp:Label ID="lblSeq" runat="server" Visible="False"></asp:Label> 
                                <br />
                                <asp:Panel ID="panelGrid_t9" runat="server" CssClass="defaultFont" ScrollBars="Auto">
                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="Grid_t9" runat="server" AllowFilteringByColumn="false"
                                        AllowMultiRowSelection="True" 
                                        AutoGenerateColumns="False" GridLines="None" 
                                        MasterTableView-GridLines="None" OnItemCommand="Grid_t9_ItemCommand" 
                                        OnItemDataBound="Grid_t9_ItemDataBound" Width="760px" Height="200px" 
                                        OnItemCreated="Grid_t9_ItemCreated">
                                        <mastertableview CommandItemDisplay="Top" DataKeyNames="bgm_proj_mng_seq" GroupLoadMode="Client" Width="100%" NoDetailRecordsText="... ไม่มีข้อมูล ...">
                                        <CommandItemTemplate>
                                            <table>
                                                <tr>
                                                    <td align="right">
                                                        <asp:LinkButton ID="AddNew_t9" runat="server" CommandName="TargetInsertClick" CssClass="LinkButton"><img alt="" src="../Image/Grid/AddRecord.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;เพิ่มข้อมูลใหม่ </asp:LinkButton>
                                                    </td>
                                                    <td>
                                                        <asp:LinkButton ID="Delete_t9" runat="server" CommandName="Delete" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"><img alt="" src="../Image/Grid/Delete.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;ลบข้อมูล</asp:LinkButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </CommandItemTemplate>
                                        <rowindicatorcolumn>
                                            <HeaderStyle Width="20px" />
                                        </rowindicatorcolumn>

                            <Columns>
                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                                <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridClientSelectColumn>
<%--                            <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="คลิกเพื่อแก้ไขข้อมูล">
                                <HeaderStyle HorizontalAlign="Center" Width="30px"/>
                                <ItemStyle Width="30px" />
                            </telerik:GridEditCommandColumn>--%>
                            <telerik:GridTemplateColumn Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbManagerSeq" runat="server" Text='<%# Eval("bgm_proj_mng_seq") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn HeaderStyle-Width="93%" 
                                HeaderStyle-HorizontalAlign="Center" HeaderText="ผู้รับผิดชอบโครงการ" ItemStyle-HorizontalAlign="Left"> 
                                <ItemTemplate>
                                    <asp:Label ID="full_name" runat="server" NavigateUrl="#" Text='<%# Eval("name") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn> 
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataField="pos_name" 
                                FilterControlWidth="100%" 
                                HeaderText="ตำแหน่ง" 
                                ShowFilterIcon="false" 
                                UniqueName="pos_name" Visible="true">
                                <HeaderStyle HorizontalAlign="Center" Width="300px"/>
                                <ItemStyle HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataField="tel" 
                                FilterControlWidth="100%" 
                                HeaderText="โทร" 
                                ShowFilterIcon="false" 
                                UniqueName="tel" Visible="true">
                                <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                <ItemStyle HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>
                            
                            </Columns>
                            <editformsettings editformtype="Template">
                            <editcolumn uniquename="EditCommandColumn1">
                                </editcolumn></editformsettings>
                            </mastertableview>
                            <clientsettings enablerowhoverstyle="true">
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                <clientevents /><selecting allowrowselect="True" />
                            </clientsettings>
                        </telerik:RadGrid>
                        </asp:Panel>
                                <br />
                            </td>
                        </tr>
                        <tr valign="top">
                            <td colspan="3" align="center">
                                <asp:Panel ID="PanelAddEdit_t9" runat="server" Visible="False" CssClass="defaultFont">
                                    <table width="95%" style="font-family: 'Segoe UI'; font-size: 13px">
                                        <tr valign="top">
                                            <td align="right" style="padding-top: 5px;">
                                            <br />
                                                บุคลากร :
                                            <br />
                                            </td>
                                            <td>
                                            </td>
                                            <td align="left" style="padding-top: 5px;">
                                                <br />
                                                <telerik:RadComboBox 
                                                 ID="ddlEmployee" runat="server" AllowCustomText="true" 
                                                 CausesValidation="false" DataTextField="text" DataValueField="value" 
                                                 EmptyMessage="... เลือกบุคลากรรับผิดชอบโครงการ ..." Filter="Contains" 
                                                 OnClientTextChange="onTextChange" Width="50%"></telerik:RadComboBox>
                                                 <asp:RequiredFieldValidator ID="v2_t9" runat="server" ControlToValidate="ddlEmployee" ErrorMessage="*" ValidationGroup="t8"></asp:RequiredFieldValidator>
                                                 <br />
                                                 <br />
                                            </td>
                                        </tr>
                                        <tr valign="top">
                                            <td colspan="3" align="center" style="padding-top: 10px;">
                                                <asp:Button ID="btnSave_t9" runat="server" onclick="btnSave_t9_Click" Text="บันทึก" ValidationGroup="t8" />
                                                <asp:Button ID="btnEdit_t9" runat="server" onclick="btnEdit_t9_Click" Text="บันทึกการเปลี่ยนแปลง" ValidationGroup="t8" Visible="False" />&#160;&#160;
                                                <asp:Button ID="btnCancel_t9" runat="server" onclick="btnCancel_t9_Click" Text="ยกเลิก" />
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
    </form>
</body>
</html>
